<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

    <head>
        <title th:text="${pageTitle}"></title>
        <div data-th-replace="layout/head-top"></div>
    </head>
    <body class="gray-bg">
        <div class="wrapper wrapper-content animated fadeInLeft">
            <div data-th-replace="common/functionDepict"></div>
            <div>
                <div class="row">
                    <div class="pt10">
                        <div class="col-sm-9">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title">
                                    <h5>填写基本信息</h5>
                                </div>
                                <div class="ibox-content clearfix pt10">
                                    <form class="form-horizontal m-t" id="agentUser-form">
                                        <div class="form-horizontal">
                                            <input type="hidden" name="id" th:value="${agentUser['id']}"/>
                                            <input type="hidden" id="userType" name="userType" th:value="${userType}"/>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 推广员名称</label>
                                                <div class="col-sm-8">
                                                    <input class="validate-data form-control" type="text" name="agentUserName" th:value="${agentUser['agentUserName']}"/>
                                                    <span class="help-block m-b-none c-999">请填写真实姓名，且需要与身份证姓名/开户行姓名保持一致</span>
                                                </div>
                                            </div>
                                            <div class="hr-line-dashed"></div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label text-right"> <i class="c-red">*</i> 手机号码</label>
                                                <div class="col-sm-8">
                                                    <input class="validate-data form-control" type="text" name="mobile" th:value="${agentUser['mobile']}"/>
                                                    <span class="help-block m-b-none c-999">推广员手机号码</span>
                                                </div>
                                            </div>
                                            <span th:if="${userType} == 2">
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label"><i class="c-red">*</i> 上级推广员</label>
                                                    <div class="col-sm-8">
                                                        <input type="hidden" id="parentId" name="parentId" th:value="${agentUser['parentId']}"/>
                                                        <input class="form-control" id="agentUserName" type="text" readonly th:value="${agentUser['parentAgentUser']}==null?'':${agentUser['parentAgentUser']['agentUserName']}"/>
                                                        <span class="help-block m-b-none c-999">选择一级推广员</span>
                                                    </div>
                                                </div>
                                            </span>
                                            <div class="hr-line-dashed"></div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 分成方式</label>
                                                <div class="col-sm-8">
                                                    <div class="radio i-checks">
                                                        <label>
                                                            <input type="radio" name="divideType" th:value="1" checked/>
                                                            <i></i><strong>固定分成</strong> - 即不论分销商传播效果如何，都固定分成比例结算
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="hr-line-dashed"></div>
                                            <span th:if="${userType} == 1">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 一级分成比例</label>
                                                    <div class="col-sm-8">
                                                        <div class="input-group m-b">
                                                            <span class="input-group-addon"><i class="fa fa-balance-scale"></i></span>
                                                            <input class="validate-data form-control" type="text" placeholder="请输入分成比例" name="oneScale" th:value="${agentUser['oneScale']}"/>
                                                            <span class="input-group-addon">%</span>
                                                        </div>
                                                        <span class="help-block m-b-none c-999">一级推广员的下线与推广的普通用户消费时，消费金额按此比例给推广员分成，请输入0-100的正整数</span>
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 二级分成比例</label>
                                                    <div class="col-sm-8">
                                                        <div class="input-group m-b">
                                                            <span class="input-group-addon"><i class="fa fa-balance-scale"></i></span>
                                                            <input class="validate-data form-control" type="text" placeholder="请输入分成比例" name="twoScale" th:value="${agentUser['twoScale']}"/>
                                                            <span class="input-group-addon">%</span>
                                                        </div>
                                                        <span class="help-block m-b-none c-999">下线的推广用户消费时，消费金额按此比例给下线分成，请输入0-100的正整数且与奖励金比例之和小于100</span>
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 奖励金比例</label>
                                                    <div class="col-sm-8">
                                                        <div class="input-group m-b">
                                                            <span class="input-group-addon"><i class="fa fa-balance-scale"></i></span>
                                                            <input class="validate-data form-control" type="text" placeholder="请输入奖金分成比例" name="bonusScale" th:value="${agentUser['bonusScale']}"/>
                                                            <span class="input-group-addon">%</span>
                                                        </div>
                                                        <span class="help-block m-b-none c-999"> 下线的推广用户消费时，消费金额按此比例奖励一级推广员，请输入0-100的正整数且与二级分成比例之和小于100</span>
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                            </span>
                                            <div id="twoscale" th:if="${userType} == 2" th:hidden="${agentUser['parentAgentUser']}==null">
                                                <div class="form-group">
                                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 分成比例</label>
                                                    <div class="col-sm-8">
                                                        <div class="input-group m-b">
                                                            <span class="input-group-addon"><i class="fa fa-balance-scale"></i></span>
                                                            <input class="form-control" type="text" name="twoScale" placeholder="请输入奖金分成比例" readonly th:value="${agentUser['parentAgentUser']}==null?0:${agentUser['parentAgentUser']['twoScale']}"/>
                                                            <span class="input-group-addon">%</span>
                                                        </div>
                                                        <span class="help-block m-b-none c-999"> 推广的用户消费时，消费金额按此比例分成给推广员，请输入0-100的正整数</span>
                                                    </div>
                                                </div>
                                                <div class="hr-line-dashed"></div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 结算周期</label>
                                                <div class="col-sm-8">
                                                    <div class="radio i-checks">
                                                        <span th:if="${userType} == 1">
                                                             <label style="height: 30px;">
                                                                <input type="radio" th:checked="${agentUser['settType']} == 1" name="settType" value="1"/><i></i><strong>随时结</strong>-随时可结算与提现
                                                            </label>
                                                            <label style="height: 30px;">
                                                                <input type="radio" th:checked="${agentUser['settType']} == 2" name="settType" value="2"/><i></i><strong>月结</strong>-自然月，以每月的1-5号为规定的结算提现日，其它时间不可结算与提现
                                                            </label>
                                                            <label style="height: 30px;">
                                                                <input type="radio" th:checked="${agentUser['settType']} == 3" name="settType" value="3"/><i></i><strong>年结</strong>-自然年，以每年最后一个月为规定的结算提现日，其它时间不可结算与提现
                                                            </label>
                                                        </span>
                                                        <span th:if="${userType} == 2">
                                                              <label style="height: 30px;">
                                                                <input type="radio" th:checked="${agentUser['settType']} == 1" name="settType" value="1"/><i></i><strong>随时结</strong>-随时可结算与提现
                                                            </label>
                                                            <label style="height: 30px;">
                                                                <input type="radio" th:checked="${agentUser['settType']} == 2" name="settType" value="2"/><i></i><strong>月结</strong>-自然月，以每月的1-5号为规定的结算提现日，其它时间不可结算与提现
                                                            </label>
                                                            <label style="height: 30px;">
                                                                <input type="radio" th:checked="${agentUser['settType']} == 3" name="settType" value="3"/><i></i><strong>年结</strong>-自然年，以每年最后一个月为规定的结算提现日，其它时间不可结算与提现
                                                            </label>
                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="hr-line-dashed"></div>
                                            <div class="form-group">
                                                <div class="col-sm-8 col-sm-offset-2">
                                                    <button th:if="${agentUser['id']} == null or ${agentUser['id']}<=0" id="save-again" class="btn btn-danger" type="button">保存，继续创建</button>
                                                    <button id="save-back" class="btn btn-primary ml10" type="button">保存，返回</button>
                                                    <button class="btn btn-white ml10" type="button" onclick="history.go(-1);">取消</button>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div data-th-replace="common/importantNotes"></div>
                </div>
            </div>
        </div>
        <div data-th-replace="layout/head-footer"></div>
        <script type="text/javascript" th:src="@{{path}/admin/business/agent/user/save-agent-user.js?v={v}(path=${staticPath},v=${v})}"></script>
    </body>
</html>
